package com.matt.domain.rel;

import com.matt.foundation.model.UnionKey;
import lombok.Data;

import javax.persistence.*;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/7/14
 * *******************************
 */
@Entity
@Data
@Table(name = "rel_teacher_course_plan_history")
public class RelTeacherCoursePlanHistory {

    @EmbeddedId
    @AttributeOverrides({@AttributeOverride(name = "domainId",column = @Column(name ="staffId",nullable = false,length =32 )),
            @AttributeOverride(name = "linkId",column = @Column(name="coursePlanId",nullable = false,length = 32))})
    private UnionKey id;

    public static RelTeacherCoursePlanHistory of(String teacherId, String coursePlanId){
        RelTeacherCoursePlanHistory relTeacherCoursePlan = new RelTeacherCoursePlanHistory();
        relTeacherCoursePlan.setId(UnionKey.of(teacherId, coursePlanId));
        return relTeacherCoursePlan;

    }
}
